import { Controller, Get, Query, UseGuards } from "@nestjs/common";
import { ApiOperation, ApiTags } from "@nestjs/swagger";
import { Roles } from "/@/logical/adminModule/auth/roles.decorator";
import { CollectService } from "../service/collect.service";
import { AuthEnum } from "/@/enum/auth.enum";
import { RolesGuard } from "/@/logical/adminModule/auth/roles.guard";
import { GetCollectDto } from "../dto/collect.dto";

@ApiTags("Collect")
@Controller("collect")
@UseGuards(RolesGuard)
export class CollectController {
  constructor(private readonly collectService: CollectService) {
    //
  }

  @Get("getCollectList")
  @Roles(AuthEnum.OPERATE, AuthEnum.OPERATE_VIEW)
  @ApiOperation({ summary: "获取所有收藏列表" })
  async getCollectList(@Query() query: GetCollectDto): Promise<any> {
    return this.collectService.getCollectList(query);
  }
}
